//
//  HomeModel.m
//  MedicineBox
//
//  Created by dllo on 15/8/22.
//  Copyright (c) 2015年 蓝鸥科技. All rights reserved.
//

#import "HomeModel.h"

@implementation HomeModel

- (void)dealloc
{
    [_image_url release];
    [_target release];
    [_namecn release];
    [_titleimg release];
    [__id release];
    [_avgprice release];
    [_refdrugcompanyname release];
    [_gongneng release];
    [_shelflife release];
    [_standard release];
    [_storage release];
    [_codename release];
    [_usage release];
    [_adr release];
    [_interaction release];
    [_contraindication release];
    [_composition release];
    [_pregnantwomentaboo release];
    [_specificationdate release];
    [_drugattribute release];
    [_note release];
    
    [super dealloc];
}

- (instancetype)initWithName:(NSString *)namecn titleimg:(NSString *)titleimg avgprice:(NSNumber *)price drugId:(NSString *)drugId type:(NSString *)type
{
    self = [super init];
    if (self) {
        self.namecn = namecn;
        self.titleimg = titleimg;
        self.avgprice = price;
        self._id = drugId;
        self.type = type;
    }
    return self;
}

+ (instancetype)medicineBoxWithName:(NSString *)namecn titleimg:(NSString *)titleimg avgprice:(NSNumber *)price drug:(NSString *)drugId type:(NSString *)type
{
    HomeModel *model = [[HomeModel alloc] initWithName:namecn titleimg:titleimg avgprice:price drugId:drugId type:type];
    return [model autorelease];
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    if ([key isEqualToString:@"_id"]) {
        __id = value;
    }
}
@end
